-- GENERATED SPELL FOR [Sunfury Arch Mage] --


function spell0_20135(pUnit, Event) --@Fiery Intellect,Self--
pUnit:FullCastSpellOnTarget(35917,pUnit)
pUnit:RegisterEvent('Sorts_20135', 613, 1)
end

function spell1_20135(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(20823,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20135', 3000, 1)
end

function spell2_20135(pUnit, Event) --@Frost Nova,Self--
pUnit:FullCastSpellOnTarget(11831,pUnit)
pUnit:RegisterEvent('Sorts_20135', 8318, 1)
end

function Sorts_20135(pUnit, Event)
local choix_sorts_20135 = math.random(0, 2)
if choix_sorts_20135 == 0 then
pUnit:RegisterEvent('spell0_20135', 1, 1)
end
if choix_sorts_20135 == 1 then
pUnit:RegisterEvent('spell1_20135', 1, 1)
end
if choix_sorts_20135 == 2 then
pUnit:RegisterEvent('spell2_20135', 1, 1)
end
end

function mob20135_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20135', math.random(1500, 3000), 1)
end

function mob20135_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20135_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20135_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20135, 1, 'mob20135_Action')
RegisterUnitEvent(20135, 2, 'mob20135_Leave')
RegisterUnitEvent(20135, 3, 'mob20135_Kill')
RegisterUnitEvent(20135, 4, 'mob20135_Die')
